/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-03 14:14:47  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import com.joysuch.wwyt.dataperm.annotation.DataPermissionField;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "WWYT_BP_INDUSTRIAL_PIPELINE")
@SQLDelete(sql = "update WWYT_BP_INDUSTRIAL_PIPELINE set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_BP_INDUSTRIAL_PIPELINE set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class BpIndustrialPipeline implements java.io.Serializable {

    // columns START
    // ID
    private Long id;
    // 统一编码
    private String uniCode;
    // 管道编号
    private String code;
    // 管道名称
    private String name;
    // 输送介质
    private String transportMedium;
    // 介质状态
    private String mediumState;
    // 输送能力
    private String transportAbility;
    // 总长度(m)
    private Float length;
    // 目前状态
    private Integer currentState;
    // 管道材质
    private String material;
    // 架设方式
    private String setupMethod;
    // 是否为压力管道
    private String isPressurePipeline;
    // 压力等级
    private String pressureLevel;
    // 是否危化品管道
    private String isHchPipeline;
    // 危化品ID
    private Long hchId;
    // 危化品名称
    private String hchName;
    // CAS 号
    private String cas;
    // 投产日期
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private java.util.Date commissioningDate;
    // 操作压力上限(kPa)
    private Float opPressureHighValue;
    // 操作压力下限(kPa)
    private Float opPressureLowValue;
    // 操作温度上限
    private Float opTemperatureHighValue;
    // 操作温度下限
    private Float opTemperatureLowValue;
    // 实际操作温度
    private Float actualOpTemperature;
    // 实际操作压力(kPa)
    private Float actualOpPressure;
    // 工作压力区间下限(kPa)
    private Float workPressureLowValue;
    // 工作压力区间上限(kPa)
    private Float workPressureHighValue;
    // 工作温度区间下限
    private Float workTemperatureLowValue;
    // 工作温度区间上限
    private Float workTemperatureHighValue;
    // 设计压力(kPa)
    private Float designPressure;
    // 创建人
    private Long createBy;
    // 创建时间
    private java.util.Date createTime;
    // 更新人
    private Long updateBy;
    // 更新时间
    private java.util.Date updateTime;
    // 删除标记
    private String deleteFlag;
    // 组织机构代码
    private String orgCode;
    // 租户
    private Long tenentId;

    // 责任部门
    @DataPermissionField(sqlColumn = "responsible_dept")
    private Long responsibleDept;
    // columns END

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    @Column(name = "UNI_CODE", length = 20)
    public String getUniCode() {
        return this.uniCode;
    }

    public void setUniCode(String value) {
        this.uniCode = value;
    }

    @Column(name = "CODE", length = 10)
    public String getCode() {
        return this.code;
    }

    public void setCode(String value) {
        this.code = value;
    }

    @Column(name = "NAME", length = 50)
    public String getName() {
        return this.name;
    }

    public void setName(String value) {
        this.name = value;
    }

    @Column(name = "TRANSPORT_MEDIUM", length = 50)
    public String getTransportMedium() {
        return this.transportMedium;
    }

    public void setTransportMedium(String value) {
        this.transportMedium = value;
    }

    @Column(name = "MEDIUM_STATE", length = 30)
    public String getMediumState() {
        return this.mediumState;
    }

    public void setMediumState(String value) {
        this.mediumState = value;
    }

    @Column(name = "TRANSPORT_ABILITY", length = 50)
    public String getTransportAbility() {
        return this.transportAbility;
    }

    public void setTransportAbility(String value) {
        this.transportAbility = value;
    }

    @Column(name = "LENGTH")
    public Float getLength() {
        return this.length;
    }

    public void setLength(Float value) {
        this.length = value;
    }

    @Column(name = "CURRENT_STATE")
    public Integer getCurrentState() {
        return this.currentState;
    }

    public void setCurrentState(Integer value) {
        this.currentState = value;
    }

    @Column(name = "MATERIAL", length = 50)
    public String getMaterial() {
        return this.material;
    }

    public void setMaterial(String value) {
        this.material = value;
    }

    @Column(name = "SETUP_METHOD", length = 30)
    public String getSetupMethod() {
        return this.setupMethod;
    }

    public void setSetupMethod(String value) {
        this.setupMethod = value;
    }

    @Column(name = "IS_PRESSURE_PIPELINE", length = 2)
    public String getIsPressurePipeline() {
        return this.isPressurePipeline;
    }

    public void setIsPressurePipeline(String value) {
        this.isPressurePipeline = value;
    }

    @Column(name = "PRESSURE_LEVEL", length = 30)
    public String getPressureLevel() {
        return this.pressureLevel;
    }

    public void setPressureLevel(String value) {
        this.pressureLevel = value;
    }

    @Column(name = "IS_HCH_PIPELINE", length = 2)
    public String getIsHchPipeline() {
        return this.isHchPipeline;
    }

    public void setIsHchPipeline(String value) {
        this.isHchPipeline = value;
    }

    @Column(name = "HCH_ID")
    public Long getHchId() {
        return this.hchId;
    }

    public void setHchId(Long value) {
        this.hchId = value;
    }

    @Column(name = "HCH_NAME", length = 30)
    public String getHchName() {
        return this.hchName;
    }

    public void setHchName(String value) {
        this.hchName = value;
    }

    @Column(name = "CAS", length = 10)
    public String getCas() {
        return this.cas;
    }

    public void setCas(String value) {
        this.cas = value;
    }

    @Column(name = "COMMISSIONING_DATE")
    public java.util.Date getCommissioningDate() {
        return this.commissioningDate;
    }

    public void setCommissioningDate(java.util.Date value) {
        this.commissioningDate = value;
    }

    @Column(name = "OP_PRESSURE_HIGH_VALUE")
    public Float getOpPressureHighValue() {
        return this.opPressureHighValue;
    }

    public void setOpPressureHighValue(Float value) {
        this.opPressureHighValue = value;
    }

    @Column(name = "OP_PRESSURE_LOW_VALUE")
    public Float getOpPressureLowValue() {
        return this.opPressureLowValue;
    }

    public void setOpPressureLowValue(Float value) {
        this.opPressureLowValue = value;
    }

    @Column(name = "OP_TEMPERATURE_HIGH_VALUE")
    public Float getOpTemperatureHighValue() {
        return this.opTemperatureHighValue;
    }

    public void setOpTemperatureHighValue(Float value) {
        this.opTemperatureHighValue = value;
    }

    @Column(name = "OP_TEMPERATURE_LOW_VALUE")
    public Float getOpTemperatureLowValue() {
        return this.opTemperatureLowValue;
    }

    public void setOpTemperatureLowValue(Float value) {
        this.opTemperatureLowValue = value;
    }

    @Column(name = "ACTUAL_OP_TEMPERATURE")
    public Float getActualOpTemperature() {
        return this.actualOpTemperature;
    }

    public void setActualOpTemperature(Float value) {
        this.actualOpTemperature = value;
    }

    @Column(name = "ACTUAL_OP_PRESSURE")
    public Float getActualOpPressure() {
        return this.actualOpPressure;
    }

    public void setActualOpPressure(Float value) {
        this.actualOpPressure = value;
    }

    @Column(name = "WORK_PRESSURE_LOW_VALUE")
    public Float getWorkPressureLowValue() {
        return this.workPressureLowValue;
    }

    public void setWorkPressureLowValue(Float value) {
        this.workPressureLowValue = value;
    }

    @Column(name = "WORK_PRESSURE_HIGH_VALUE")
    public Float getWorkPressureHighValue() {
        return this.workPressureHighValue;
    }

    public void setWorkPressureHighValue(Float value) {
        this.workPressureHighValue = value;
    }

    @Column(name = "WORK_TEMPERATURE_LOW_VALUE")
    public Float getWorkTemperatureLowValue() {
        return this.workTemperatureLowValue;
    }

    public void setWorkTemperatureLowValue(Float value) {
        this.workTemperatureLowValue = value;
    }

    @Column(name = "WORK_TEMPERATURE_HIGH_VALUE")
    public Float getWorkTemperatureHighValue() {
        return this.workTemperatureHighValue;
    }

    public void setWorkTemperatureHighValue(Float value) {
        this.workTemperatureHighValue = value;
    }

    @Column(name = "DESIGN_PRESSURE")
    public Float getDesignPressure() {
        return this.designPressure;
    }

    public void setDesignPressure(Float value) {
        this.designPressure = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }

    @Column(name = "responsible_dept")
    public Long getResponsibleDept() {
        return responsibleDept;
    }

    public void setResponsibleDept(Long responsibleDept) {
        this.responsibleDept = responsibleDept;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
                .append("uniCode", getUniCode()).append("code", getCode()).append("name", getName())
                .append("transportMedium", getTransportMedium()).append("mediumState", getMediumState())
                .append("transportAbility", getTransportAbility()).append("length", getLength())
                .append("currentState", getCurrentState()).append("material", getMaterial())
                .append("setupMethod", getSetupMethod()).append("isPressurePipeline", getIsPressurePipeline())
                .append("pressureLevel", getPressureLevel()).append("isHchPipeline", getIsHchPipeline())
                .append("hchId", getHchId()).append("hchName", getHchName()).append("cas", getCas())
                .append("commissioningDate", getCommissioningDate())
                .append("opPressureHighValue", getOpPressureHighValue())
                .append("opPressureLowValue", getOpPressureLowValue())
                .append("opTemperatureHighValue", getOpTemperatureHighValue())
                .append("opTemperatureLowValue", getOpTemperatureLowValue())
                .append("actualOpTemperature", getActualOpTemperature())
                .append("actualOpPressure", getActualOpPressure())
                .append("workPressureLowValue", getWorkPressureLowValue())
                .append("workPressureHighValue", getWorkPressureHighValue())
                .append("workTemperatureLowValue", getWorkTemperatureLowValue())
                .append("workTemperatureHighValue", getWorkTemperatureHighValue())
                .append("designPressure", getDesignPressure()).append("createBy", getCreateBy())
                .append("createTime", getCreateTime()).append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime()).append("deleteFlag", getDeleteFlag())
                .append("orgCode", getOrgCode()).append("tenentId", getTenentId()).toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpIndustrialPipeline == false)
            return false;
        if (this == obj)
            return true;
        BpIndustrialPipeline other = (BpIndustrialPipeline) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
